﻿{include file="public/head" title="取消订单" keywords="取消订单" description="取消订单" /}
<style>

</style>
<div id="offCanvasWrapper" class="mui-off-canvas-wrap mui-draggable">
	<!-- 菜单容器 -->

	<div class="mui-inner-wrap">
		<div id="offCanvasContentScroll" class="mui-content mui-scroll-wrapper" style="background-color: #fff;">
			<div class="mui-scroll">
				<header class="tx_head">
					<p>
						<a href="{:url('index')}" class="header_p1"><span class="mui-icon mui-icon-arrowleft"></span></a>
					<h5 >取消订单</h5>
					</p>
				</header>
				<main class="wdzh_main">
					<section class="">
						<ul class="">
							<li class="jyjl_li" style="border-bottom: 7px solid #f3f3f3;line-height: 0;height: 0.1rem;">
							</li>
							<li  class="toauth">
								<b style="font-size: 1rem;margin-left: 0.5rem;">取消原因</b>
							</li>
							<notempty  name="$sf_quxiao">
							<li  class="toauth" style="height: auto">
								{foreach $sf_quxiao as $v}
								<span class=" mui-radio mui-left" style="margin-left: -10px;width: 100%;height: 31px;line-height: 31px">
                                    <input name="radio1"  value="{$v}"  checked type="radio">
                                    <label style="font-size: 1rem;">{$v}</label>
                                </span>
								{/foreach}
							</li>
							</notempty>
							<li  class="toauth"  style="height: auto;">
								<span class=" mui-radio mui-left" style="margin-left: -10px;width: 100%;height: 31px;line-height: 31px"">
                                    <input name="radio1"  value="1"  type="radio">
                                    <label style="font-size: 1rem;">其他</label>
                                </span>
							</li>
							<li class="toauth" id="quxiao_remake" style="height: auto;">
								<textarea name="quxiao_remake" placeholder="请填写原因" style="margin-top: 1rem;"></textarea>
							</li>
							<li class="toauth">
								<button type="submit"  style=" width: 90%; margin-left: 5%;margin-right: 5%;margin-top: 1rem; border-color: #01cebf;color: #01cebf;">提交</button>
							</li>
						</ul>
						<input type="hidden" name="id" value="{$order_mun}">
					</section>
				</main>
				<br>
				<br>
				<br>
				<br>
				<br>
				<br>
			</div>
		</div>
		<div class="mui-off-canvas-backdrop"></div>
	</div>
</div>
{include file="public/footer"}
</body>
<script>
    $('button[type="submit"]').click(function () {
        var id = $('input[name="id"]').val();
        var radio1 = $('input[name="radio1"]:checked').val();
        var quxiao_remake = $('textarea[name="quxiao_remake"]').val();
        if (radio1 != 1){
            quxiao_remake = radio1 +'>>>>'+ quxiao_remake;
		}
        if (quxiao_remake==''){
            layer.msg('请填写取消原因',{iocn:2,time:1000});
			return false;
		}
		$.post("{:url('todelorder')}",{quxiao_remake:quxiao_remake,id:id},function (res) {
			if (res.code == 1 ){
                layer.msg(res.msg,{iocn:1,time:1000},function () {
                    window.location.href="/index/account/index";
                });
			}else {
                layer.msg(res.msg,{iocn:2,time:1000});
			}
        });
    })
</script>
</html>